@extends('admin.public.base')
@section('title','添加用户')
@section('my-css')
<link rel="stylesheet" href="{{url('/css/admin/colorpicker.css')}}" />
<link rel="stylesheet" href="{{url('/css/admin/datepicker.css')}}" />
<link rel="stylesheet" href="{{url('/css/admin/uniform.css')}}" />
<link rel="stylesheet" href="{{url('/css/admin/select2.css')}}" />
<link rel="stylesheet" href="{{url('/css/admin/bootstrap-wysihtml5.css')}}" />
@endsection

@section('content')
<div id="content">
<div id="content-header">
  <div id="breadcrumb"> <a href="index.html" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a> <a href="{{url('/admin/index1')}}" class="tip-bottom">用户列表</a> <a href="#" class="current">编辑用户</a> </div>
  <h1>编辑用户</h1>
</div>
<div class="container-fluid">
  <hr>
  <div class="row-fluid">
    <div class="span6">
      <div class="widget-box">
        <div class="widget-title"> <span class="icon"> <i class="icon-align-justify"></i> </span>
          <h5>编辑用户</h5>
        </div>
        <div class="widget-content nopadding">
          <form id='add_form' action="{{url('/admin/doedit')}}/{{$arr->id}}" method="post" class="form-horizontal">
          <input type="hidden" name="_token" value="{{csrf_token()}}"/>
            <div class="control-group">
              <label class="control-label">姓名:</label>
              <div class="controls">
                <input type="text" class="span11" name='name' value="{{$arr->name}}" placeholder="请输入您的名字" />
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">手机号:</label>
              <div class="controls">
                <input type="text" class="span11" name='phone' value="{{$arr->phone}}" placeholder="请输入您的手机号" />
              </div>
            </div>
           
            <div class="control-group">
              <label class="control-label">地址:</label>
              <div class="controls">
                <input type="text" class="span11" name='address' value="{{$arr->address}}" placeholder="请输入您的地址" />
              </div>
            </div>
            <div class="form-actions">
              <button type="button" class="btn btn-success">确认修改</button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>
</div>
@endsection

@section('my-js')
<script src="{{url('/js/bootstrap-colorpicker.js')}}"></script> 
<script src="{{url('/js/bootstrap-datepicker.js')}}"></script> 
<script src="{{url('/js/jquery.toggle.buttons.html')}}"></script> 
<script src="{{url('/js/masked.js')}}"></script> 
<script src="{{url('/js/select2.min.js')}}"></script> 
<script src="{{url('/js/matrix.form_common.js')}}"></script> 
<script src="{{url('/js/wysihtml5-0.3.0.js')}}"></script> 
<script src="{{url('/js/bootstrap-wysihtml5.js')}}"></script>
<script>
$(function(){
  $('.btn').click(function(){
      var phone_preg = /^1[34578]\d{9}$/;
      if(!phone_preg.test($('#add_form input[name=phone]').val())){
            alert('请输入正确手机号');
            return false;
      }
      if($('#add_form input[name=name]').val() == '' || $('#add_form input[name=address]').val() == '' ){
        alert('用户名和地址不能为空');
        return false;
      }else{
          $('#add_form').submit();
      }
  });
});
</script>
@endsection



